How to protect against multiple #includes?

When programming in C I would protect against include header multiple times with this appraoch (example from wikipedia):


#ifndef GRANDPARENT_H

#define GRANDPARENT_H

// Code here
#endif 
/* GRANDPARENT_H */

Can anyone suggest how I can do the same in DXL to avoid these errors/warnings please?

 

 

[progress] Executing MY.dxl

 -E- DXL: <addins\\user\\lib\\common.dxl:3> (SEP) already declared in this scope

Included from:
<addins\\user\\lib\\links.dxl:4> <Line:84> 
<C:\Users\USER\AppData\Local\Temp\DXLEditor\launcher_2707882706261835687.dxl:15> <Line:1> 

 

-E- DXL:<addins\\user\\lib\\common.dxl:4> (ANY) already declared in this scope
Included from:<addins\\user\\lib\\links.dxl:4> <Line:84> 
<C:\Users\USER\AppData\Local\Temp\DXLEditor\launcher_2707882706261835687.dxl:15> <Line:1> 

 


natmat - Fri Oct 20 09:18:26 EDT 2017

Re: How to protect against multiple #includes?
Mathias Mamsch - Sun Oct 22 06:42:51 EDT 2017

He had several discussions about include dependencies inside the forum, e.g. here: 

https://www.ibm.com/developerworks/community/forums/html/topic?id=7267362c-7f25-4eb1-9056-46809a3bed0d&ps=25

https://www.ibm.com/developerworks/community/forums/html/topic?id=545d8ccd-a4f6-4d32-84d5-41fe15661677&ps=25

There is no #IFDEF preprocessor directive in DXL ... So you need to take care about your includes in a different way, than in C. If you use a large DXL library with dependencies across the library modules, I would suggest, that you follow the advice from the above posts for managing dependencies. 

Regards, Mathias

 

Re: How to protect against multiple #includes?
natmat - Fri Oct 27 11:06:48 EDT 2017

Mathias Mamsch - Sun Oct 22 06:42:51 EDT 2017

He had several discussions about include dependencies inside the forum, e.g. here: 

https://www.ibm.com/developerworks/community/forums/html/topic?id=7267362c-7f25-4eb1-9056-46809a3bed0d&ps=25

https://www.ibm.com/developerworks/community/forums/html/topic?id=545d8ccd-a4f6-4d32-84d5-41fe15661677&ps=25

There is no #IFDEF preprocessor directive in DXL ... So you need to take care about your includes in a different way, than in C. If you use a large DXL library with dependencies across the library modules, I would suggest, that you follow the advice from the above posts for managing dependencies. 

Regards, Mathias

 

Thank you for the links Mattias. I kno have a clear idea of what I need to do to resolve the issues I was having.